@import "./variables";

//  全局样式
* {
  margin: 0;
  padding: 0;
  list-style-type: none;
  box-sizing: border-box;
  outline: none;
}

html {
  font-size: 13px;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.2em;
  background-color: #f1f1f1;
}

a {
  color: #343440;
  text-decoration: none;
}

.clearfix {
  &::after {
    content: "";
    display: table;
    height: 0;
    line-height: 0;
    visibility: hidden;
    clear: both;
  }
}

//浮动
.float-r {
  float: right;
}

// 宽高
.w-100 {
  width: 100%;
}
.h-100 {
  height: 100%;
}

//颜色
@each $colorkey, $color in $colors {
  .text-#{$colorkey} {
    color: $color;
  }
  .bg-#{$colorkey} {
    background-color: $color;
  }
}

//对齐
@each $var in (left, center, right) {
  .text-#{$var} {
    text-align: $var !important;
  }
}

//flex
@each $key, $value in $flex-jc {
  .jc-#{$key} {
    justify-content: $value;
  }
}

//字体
@each $fontkey, $fontvalue in $font-sizes {
  .fs-#{$fontkey} {
    font-size: $fontvalue * $base-font-size;
  }
}

@each $key, $value in $flex-ai {
  .ai-#{$key} {
    align-items: $value;
  }
}

//.mt-1 => margin top
//spacing

@each $typekey, $type in $spacing-types {
  //.m-1
  @each $sizekey, $size in $spacing-sizes {
    .#{$typekey}-#{$sizekey} {
      #{$type}: $size * $spacing-base-size;
    }
  }

  //.mx-1
  @each $sizekey, $size in $spacing-sizes {
    .#{$typekey}x-#{$sizekey} {
      #{$type}-left: $size * $spacing-base-size;
      #{$type}-right: $size * $spacing-base-size;
    }
    .#{$typekey}y-#{$sizekey} {
      #{$type}-top: $size * $spacing-base-size;
      #{$type}-bottom: $size * $spacing-base-size;
    }
  }
  //.mt-1
  @each $directionkey, $direction in $spacing-directions {
    @each $sizekey, $size in $spacing-sizes {
      .#{$typekey}#{$directionkey}-#{$sizekey} {
        #{$type}-#{$direction}: $size * $spacing-base-size;
      }
    }
  }
  .#{$typekey} {
    #{$type}: 0;
  }
}

//卡片头部
.card {
  margin-bottom: 0.7692rem;
  border-bottom: 1px #d4d9de solid;

  .card-body {
    .title-item {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      width: 22.8462rem;
    }
  }
}

//文章一行显示，多余省略号显示
.title-item {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 22.8462rem;
}

//按钮
.btn {
  border: none;
  border-radius: 0.1538rem;
  font-size: map-get($font-sizes, "sm") * $base-font-size;
  &.btn-lg{
    border: 1px solid #eceef0;
    background-color: #fcfcfc;
    display: flex;
    justify-content: center;
    font-size: 1rem;
    align-items: center;
    i{
      margin-right: 0.7692rem;
      color: map-get($colors, 'primary' );
      font-weight: bold;
      font-size: 1.5rem;
    }
  }
}
.nav {
  display: flex;
  justify-content: space-between;
  .nav-item {
    border-bottom: 3px solid transparent;
    padding-bottom: 0.2rem;
    color: map-get($colors, "dark");
    &.active {
      color: map-get($colors, "primary");
      border-bottom: 3px solid map-get($colors, "primary");
    }
  }

  &.nav-invers {
    .nav-item {
      justify-content: space-around;
      color: map-get($colors, "white");
    }
    &.active {
      border-color: #ffffff;
    }
  }
}

//border
.border-none {
  border: none !important;
}
@each $dir in (top, right, bottom, left) {
  .border-#{$dir} {
    border-#{$dir}: 1px solid #d4d4d5;
  }
}

//sprite图标
.sprite {
  background: url(../index/index.png) no-repeat 0 0;
  display: inline-block;
  background-position: 63.546% 15.517%;
  background-size: 28.8462rem;
  .nav-item {
    &::after {
      position: absolute;
      top: 0;
      right: 0;
      display: block;
      height: 100%;
      width: 1px;
      background: #d4d9de;
    }
  }
  &.sprite-news {
    width: 1.7692rem;
    height: 1.5385rem;
  }
  &.sprite-practice {
    width: 1.7692rem;
    height: 1.5385rem;
    background-position: 90.483% 15.614%;
  }
  &.sprite-affair {
    background-position: 36.746% 0.924%;
    width: 1.4615rem;
    height: 1.6923rem;
  }
  &.sprite-mall {
    background-position: 10.408% 15.517%;
    width: 1.5385rem;
    height: 1.5385rem;
    border: none;
  }
  &.sprite-start {
    background-position: 89.733% 1.266%;
    width: 1.5385rem;
    height: 1.6154rem;
  }
  &.sprite-honour {
    background-position: 36.467% 15.287%;
    width: 1.8462rem;
    height: 1.5385rem;
  }
  &.sprite-community {
    background-position: 9.728% 1.266%;
    width: 2rem;
    height: 1.6154rem;
  }
  &.sprite-base {
    margin-top: -3px;
    background-position: 63.3% 0.927%;
    width: 1.8462rem;
    height: 1.8462rem;
  }
  &.sprite-echart {
    background-position: 0 96.207%;
    width: 1.8462rem;
    height: 1.5385rem;
  }
  &.sprite-edition {
    background: url(../index/sprite-edition.png) no-repeat -1px 0px;
    width: 1.8462rem;
    height: 1.8462rem;
  }
}
